package com.note.utils;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.extra.mail.MailAccount;
import cn.hutool.extra.mail.MailUtil;
import org.junit.Test;

public class MailUtils {
    public static void send(String to,String vcode){
        MailAccount mail = new MailAccount();
        mail.setHost("smtp.qq.com");
        mail.setSslEnable(true);
        mail.setPort(465);
        mail.setFrom("hu8307@qq.com");
        mail.setUser("hu8307@qq.com");
        mail.setPass("dotkkjqkavakjdie");

        MailUtil.send(mail, CollUtil.newArrayList(to),"你的验证码","你的验证码是"+vcode,false);
    }
}
